var url = require('url');

var urlObj = url.parse("https://user:pass@sub.host.com:8080/p/a/t/h?query=string&name=11");

console.log(urlObj.port);

console.log(urlObj.protocol);

console.log(urlObj.host);

console.log(urlObj.hostname);

console.log(urlObj.search);

console.log(urlObj.path);

console.log(urlObj.pathname);

console.log(urlObj.hash);

console.log(urlObj.href);
